home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-13 | 1.2 KB | 50 lines | [TEXT/MPS ] |
- # This script assumes that the target Macintosh has a Dialog up on the screen.
- # The script will check the margins of the dialog to make sure they are wide
- # enough.
-
- Libraries "Ivy.vulib";
-
- # Set up Ivy.
-
- result := IVInit( true );
- IVDeleteImageFile( 'theFrame' );
- IVDeleteImageFile( 'theDialog' );
- IVDeleteImageFile( 'theDiff' );
-
- # Get the dimensions of the front Dialog.
-
- match[ window o:1 r:?theRect s:Dialog ];
- if ( isUndefined( theRect ) )
- begin
- println 'There is no front dialog!';
- exit;
- end;
-
- theInsetRect := { 8, 8,
- theRect[3] - theRect[1] - 8, theRect[4] - theRect[2]- 8 };
-
- # Capture Dialog image, but erase its contents.
-
- result := IVCreateImageFile( 'theFrame', theRect, { theInsetRect } );
- if ( result[2] <>true )
- exit;
-
- # Capture the entire Dialog image.
-
- result := IVCreateImageFile( 'theDialog', theRect );
- if ( result[2] <> true )
- exit;
-
- theInsetRect := { 14, 14,
- theRect[3] - theRect[1] - 14, theRect[4] - theRect[2]- 14 };
-
- # Compare the two images, but ignore the interior contents.
-
- result := IVCompareImageFiles( 'theDialog', 'theFrame', 'theDiff', { theInsetRect } );
- if ( result[1] <> 0 )
- exit;
-
- if ( result[2] = true )
- println 'The window’s margins were clean.';
- else
- println 'The window’s margins were dirty.';